package io.adrainty.bolee.trade.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.adrainty.bolee.framework.commons.basic.ResultDTO;
import io.adrainty.bolee.framework.commons.utils.ResultDTOUtil;
import io.adrainty.bolee.trade.models.entity.PayChannelEntity;
import io.adrainty.bolee.trade.service.IPayChannelService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/31 下午10:54
 */

@Tag(name = "支付渠道")
@RestController
@RequestMapping("pay-channel")
public class PayChannelController {

    @Resource
    private IPayChannelService payChannelService;

    @PostMapping("/page/{pageNum}/{pageSize}")
    public ResultDTO<IPage<PayChannelEntity>> page(
            @RequestBody PayChannelEntity param,
            @PathVariable("pageNum") Integer pageNum,
            @PathVariable("pageSize") Integer pageSize) {
        IPage<PayChannelEntity> result = payChannelService.pageData(pageNum, pageSize, param);
        return ResultDTOUtil.success(result);
    }

}
